#include <iostream>
#include "Interpolation.h"

using namespace std;

int main()
{
  vector<double> x{0.0,0.0,3.0,3.0,5.0,5.0,8.0,8.0,13.0,13.0};
  vector<double> y{0.0,225.0,383.0,623.0,993.0}, dy{75.0,77.0,80.0,74.0,72.0};
  Hermite_formula Hermite(x,y,dy);
  cout << Hermite.operate(10) << endl;
  cout << (Hermite.operate(10.00001)-Hermite.operate(9.99999))/0.00002 << endl;
  bool check = true;
  for(double i = 0; i <= 13; i += 0.01)
    {
      if((Hermite.operate(i+0.00001)-Hermite.operate(i-0.00001))/0.00002 > 81)
	{
	  cout << "The car exceeds the speed limit." << endl;
	  check = false;
	  break;
	}
    }
  if(check)
    cout << "The car doesn't exceed the speed limit." << endl;
  return 0;
}
